package com.nsgf.library.data.bean;

import java.util.ArrayList;
import java.util.List;

/**
 * 结构组件检查项数据模型
 */
public class StructureComponentBean {
    private String componentName; // 组件名称：闸墩、边墙、胸墙、工作桥
    private List<CheckItem> checkItems; // 检查项列表
    
    public StructureComponentBean(String componentName) {
        this.componentName = componentName;
        this.checkItems = new ArrayList<>();
        // 初始化检查项：位移、倾斜、裂缝、渗漏
        checkItems.add(new CheckItem("位移", false));
        checkItems.add(new CheckItem("倾斜", false));
        checkItems.add(new CheckItem("裂缝", false));
        checkItems.add(new CheckItem("渗漏", false));
    }
    
    public String getComponentName() {
        return componentName;
    }
    
    public void setComponentName(String componentName) {
        this.componentName = componentName;
    }
    
    public List<CheckItem> getCheckItems() {
        return checkItems;
    }
    
    public void setCheckItems(List<CheckItem> checkItems) {
        this.checkItems = checkItems;
    }
    
    /**
     * 获取已选中的检查项名称列表
     */
    public List<String> getSelectedCheckItemNames() {
        List<String> selectedNames = new ArrayList<>();
        for (CheckItem item : checkItems) {
            if (item.isSelected()) {
                selectedNames.add(item.getName());
            }
        }
        return selectedNames;
    }
    
    /**
     * 检查项
     */
    public static class CheckItem {
        private String name; // 检查项名称
        private boolean selected; // 是否选中
        
        public CheckItem(String name, boolean selected) {
            this.name = name;
            this.selected = selected;
        }
        
        public String getName() {
            return name;
        }
        
        public void setName(String name) {
            this.name = name;
        }
        
        public boolean isSelected() {
            return selected;
        }
        
        public void setSelected(boolean selected) {
            this.selected = selected;
        }
    }
}

